package cn.wolfcode.service.Impl;

import cn.wolfcode.domain.User;
import cn.wolfcode.mapper.UserMapper;
import cn.wolfcode.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

@Service("IUserService")
@Scope("prototype")
public class UserServiceImpl implements IUserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public void insert(User user) {
        userMapper.insert(user);
    }

    @Override
    public void dalete(Long id) {
        userMapper.dalete(id);
    }

    @Override
    public void update(User user) {
        userMapper.update(user);
    }

    @Override
    public User selectid(Long id) {
        User selectid = userMapper.selectid(id);
        return selectid;
    }

    @Override
    public User selectu(String username) {
        System.out.println(username);
        User selectu = userMapper.selectu(username);
        return selectu;
    }

    @Override
    public User selectup(String username, String password) {
        User selectup = userMapper.selectup(username, password);
        return selectup;
    }
}
